#include <stdio.h>
#include "compare.h"

typedef int (*Func) (void *, void *);
 
static void
compare (void *a, void *b, Func callback)
{
        int r = callback (a, b);
         
        if (r == -1)
                printf ("a < b\n");
        else if (r == 0)
                printf ("a = b\n");
        else
                printf ("a > b\n");
}
 
 
int
main (void)
{       
        float a = 123.567;
        float b = 222.222;
        Func func = float_compare;
        compare (&a, &b, func);
         
        char *s1 = "hello world!";
        char *s2 = "hello!";
        func = str_compare;
        compare (s1, s2, func);

        func = str_compare_new;
        compare(s1, s2, func);
         
        return 0;
}
